package com.lizhijun.controller;

import com.lizhijun.pojo.User;
import com.lizhijun.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/login")
    public String login(User user){
        User user1 = userService.findUser(user);
        if(user1 != null && "2".equals(user1.getIdentity())){
            return "index";
        }else if(user1 != null && "1".equals(user1.getIdentity())){
            return "salary";
        }
        return null;
    }

}
